package appconfig

import "github.com/spf13/viper"

type AppConfig struct {
	Mysql
	Redis
	Alipay
}

type Mysql struct {
	Host     string
	Pose     int
	User     string
	Password string
	DB       string
}
type Redis struct {
	Addr     string
	Password string
	DB       int
}

type Alipay struct {
	AppId      string
	PrivateKey string
	NotifyURL  string
	ReturnURL  string
	Subject    string
}

var AppConf AppConfig

func Init() {
	viper.SetConfigFile("../recharge_srv/appconfig/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppConf)
}
